import { buildUUID } from '../utils'
import { captchaData } from './data'
import Mock from 'mockjs'
export default [
  {
    url: '/system/captcha/get',
    method: 'post',
    response: data => {
      const imageName = Mock.Random.integer(1, 9) + ''
      return {
        code: 200,
        status: true,
        msg: '请完成人机校验',
        data: {
          originalImageBase64: captchaData[data.body.captchaType][imageName].originalImageBase64,
          jigsawImageBase64: captchaData[data.body.captchaType][imageName].jigsawImageBase64,
          token: buildUUID(),
          secretKey: buildUUID()
        }
      }
    }
  },
  {
    url: '/system/captcha/check',
    method: 'post',
    response: data => {
      return {
        'code|1': [200, 300],
        status: true,
        msg: '验证成功！',
        data: null
      }
    }
  }
]
